# ifndef __HoluxArd_H_
# define __HoluxArd_H_

# include "HoluxCrd.h"

# ifdef _MSC_VER
#	pragma pack (push, 1)
# endif

struct CArdHdr {
	BYTE  btAdmLevel;
	BYTE  btReserved [3];

	DWORD dwAdmDataOffset;
	DWORD dwSubadmDataOffset;

	WORD  wCountry; // see CrdCountry
	WORD  wAdmNum;
	WORD  wSubadmNum;

	WORD  wReserved0;

	DWORD dwIndexOffset;
	DWORD dwIndexSize;
};

struct CArdHdr2 {
	BYTE  btLanguage;
	BYTE  btBase;

	BYTE  btNavigable;
	BYTE  btInfoUSA;

	DWORD dwMapHdrOffset;

	DWORD dwReserved3;
	DWORD dwReserved4;
	DWORD dwReserved5;
	DWORD dwReserved6;
};

struct CArdMapHdr {
	char  strName [32];
	DWORD dwMapId;
	DWORD dwVer;
	BYTE  btDatum;
	BYTE  btContent;

	BYTE  btTypeNum;
	BYTE  btScaleNum;

	DWORD dwScalesOffset;
	DWORD dwBlocksOffset;
	DWORD dwTypesOffset;

	DWORD dwPolylinesOffset;
	DWORD dwPolygonsOffset;
	DWORD dwPointsOffset;

	DWORD dwPolylinePartOffset;
	DWORD dwPolygonPartOffset;

	DWORD dwNamesOffset;
	DWORD dwNodesOffset;
};

struct CArdMapHdr2 {
	DWORD dwArcsOffset;
	DWORD dwReserved0;
	DWORD dwReserved1;
	DWORD dwReserved2;
	DWORD dwReserved3;

	LONG  lX0, lY0, lX1, lY1;
};

struct CArdBlock {
	DWORD dwFirstTypeIdx;
	DWORD dwTypes;
	DWORD dwFirstNodeOffset;
	DWORD dwNodes;
};

struct CArdPolygon {
	CCrdStringRef Label;

	DWORD dwFirstPointIdx;
	DWORD dwPoints;

	LONG  lX0, lY1;
	WORD  wWidth, wHeight;
};

struct CArdPolyline {
	CCrdStringRef Label;

	WORD  wAdmId;

	WORD  wPoints;
	DWORD dwFirstPointIdx;

	LONG  lX0, lY1;
	WORD  wWidth, wHeight;
};

struct CArdPoint {
	CCrdStringRef Label;

	WORD  wAdmId;

	WORD  wBlockId;
	WORD  wX, wY;
};

struct CArdNode {
	DWORD dwFirstArcIdx;
	DWORD dwNodeID;
	DWORD fArcs  : 4,
	      x      : 12,
		  fClass : 3,
		  bCross : 1,
		  y      : 12;
};

struct CArdArc {
	DWORD fAspect       : 4,
	      dwPolylineIdx : 28;

	DWORD fClass     : 3,
	      bReverse   : 1,
	      dwPtIdx    : 28;
	DWORD bHighway   : 1,
	      bOneWay    : 1,
	      dwToNodeID : 30;

	WORD wPtNum;
	WORD wLength;
};

# ifdef _MSC_VER
#	pragma pack (pop)
# endif


# endif // __HoluxArd_H_